TrainPlanForm = Ext.extend(Ext.Window,
{
    constructor : function(a) {
        Ext.applyIf(this, a);
        this.initUIComponents();
        TrainPlanForm.superclass.constructor.call(this, {
            layout : "fit",
            id : this.inputFormName,
            items : yearGridFormPanel,
            modal : true,
            bodyStyle : "padding:2px;",
            buttonAlign : "center",
            buttons : yearGridFormButtons,
            title : "培训计划信息添加",
            iconCls : "menu-flowWait",
            width : 620,
            height : 375
        });
    },
    //初始化数据
    initUIComponents : function() {
        createyeargridform({
            operation:this,
            form:{
                saveUrl: __ctxPath+"/safecultruetrain/saveTrainPlan.do",
                items:[
                        {
                            id : "trainPlan.id",
                            name : "trainPlan.id",
                            xtype : "hidden",
                            value : this.id == null ? "": this.id
                        }, {
                            name : "trainPlan.years",
                            xtype : "hidden",
                            id : "trainPlan.years",
                            value : this.years == null ? "" : this.years
                        },{
                           layout:"column",
                           bodyStyle:"padding:5px;",
                           items:[{
                               layout:"form",
                               bodyStyle:"padding:5px;",
                               border:false,
                               columnWidth:.5,
                                   items:[{
                                       xtype:"textfield",
                                       fieldLabel:'计划编号' + '<font color=red>*</font>',
                                       name:'trainPlan.trainPlanNo',
                                       maxLength:80,
                                       allowBlank:false,
                                       width:146
                                   }]
                               },{
                                   layout:"form",
                                   bodyStyle:"padding:5px;",
                                   border:false,
                                   columnWidth:.5,
                                   items:[{
                                       xtype:"textfield",
                                       fieldLabel:'培训名称',
                                       name:'trainPlan.trainPlanName',
                                       maxLength:80,
                                       width:146
                                   }]
                               },{
                                   layout:"form",
                                   bodyStyle:"padding:5px;",
                                   border:false,
                                   columnWidth:.5,
                                   items:[{
                                       //下拉选型设置
                                           fieldLabel : "所属机构",
                                           hiddenName : "trainPlan.institution",
                                           xtype : "combo",
                                           mode : "local",
                                           editable : false,
                                           width:146,
                                           triggerAction : "all",
                                           store:new Ext.data.ArrayStore({
                                               id:0,
                                               fields:['id','type'],
                                               data:[ [ "1", "组织部" ],
                                                      [ "2", "财务部" ],
                                                      [ "3", "销售部" ]]
                                           }),
                                           valueField:'type',
                                           displayField:'type',
                                           value:"销售部" 
                                   }]
                               },{
                                   layout:"form",
                                   bodyStyle:"padding:5px;",
                                   border:false,
                                   columnWidth:.5,
                                   items:[{
                                       fieldLabel:'培训类别',
                                       hiddenName:"trainPlan.trainClassification",
                                       xtype:"combo",
                                       mode:"local",
                                       editable:false,
                                       width:146,
                                       triggerAction:"all",
                                       store:new Ext.data.ArrayStore({
                                          id:0,
                                          fields:['id','type'],
                                          data:[['1','新从业人员进厂培训'],
                                                ['2','特种作业人员培训'],
                                                ['3','安全管理人员培训'],
                                                ['4','班组长培训'],
                                                ['5','转岗复工培训'],
                                                ['6','职业健康培训'],
                                                ['7','全员教育培训']]
                                       }),
                                       valueField:'type',
                                       displayField:'type',
                                       value:'新从业人员进厂培训'
                                   }]
                                   /*items:[{
                                       fieldLabel:'培训类别',
                                       hiddenName:"trainPlan.trainClassification",
                                       xtype:"combo",
                                       mode:"local",
                                       editable:false,
                                       width:146,
                                       triggerAction:"all",
                                       displayField:"codeNo",
                                       valueField:"dicNo",
                                       hiddenField:"dicNo",
                                       store:new Ext.data.Store({
                                           url:"",
                                           baseParams:{dicNo:this.dicNo},
                                           autoLoad:true,
                                           reader:new Ext.data.JsonReader({},[{
                                           }])
                                       })
                                   }]*/
                               },{
                                   layout:'form',
                                   bodyStyle:"padding:5px;",
                                   border:false,
                                   columnWidth:.5,
                                   items:[{
                                          xtype:'datefield',
                                          fieldLabel:'计划开始时间',
                                          id:'trainPlan.trainStartTime',
                                          name:'trainPlan.trainStartTime',
                                          format:'y-m-d',
                                          width:146
                                   }]
                               },{
                                   layout:'form',
                                   bodyStyle:'padding:5px;',
                                   border:false,
                                   columnWidth:.5,
                                   items:[{
                                       xtype:'datefield',
                                       fieldLabel:'计划结束时间',
                                       id:'trainPlan.trainEndTime',
                                       name:'trainPlan.trainEndTime',
                                       format:'y-m-d',
                                       width:146
                                   }]
                               }
                            ]
                       },{
                           layout:'column',
                           bodyStyle:"padding:5px;",
                           border:false,
                           items:[{
                               layout:"form",
                               bodyStyle:"padding:5px;",
                               columnWidth:1.,
                               items:[{
                               xtype:"textarea", 
                               fieldLabel: '计划内容', 
                               name: 'trainPlan.trainPlanContent', 
                               width : 448 
                               }]
                           }]
                       },{
                           layout:'column',
                           bodyStyle:"padding:5px;",
                           border:false,
                           items:[{
                               layout:'form',
                               bodyStyle:"padding:5px;",
                               columnWidth:1.,
                               items:[{
                               xtype:'textarea',
                               fieldLabel:'备注',
                               name:'trainPlan.remark',
                               width:448
                               }]
                           }]
                       }
               ]
            },
            loadData:{
                getUrl:__ctxPath +"/safecultruetrain/getTrainPlan.do",
                preName : "trainPlan"
            }
        });
    }
});
